package com.ruoyi.system.service.impl;

import com.ruoyi.common.core.text.Convert;
import com.ruoyi.system.domain.YtConstructionContract;
import com.ruoyi.system.domain.YtCustomerInvoice;
import com.ruoyi.system.mapper.YtConstructionContractMapper;
import com.ruoyi.system.service.IYtConstructionContractService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 施工合同Service业务层处理
 * 
 * @author magichaohao
 * @date 2021-05-18
 */
@Service
public class YtConstructionContractServiceImpl implements IYtConstructionContractService 
{
    @Autowired
    private YtConstructionContractMapper ytConstructionContractMapper;

    /**
     * 查询施工合同
     * 
     * @param constructionId 施工合同ID
     * @return 施工合同
     */
    @Override
    public YtConstructionContract selectYtConstructionContractById(Long constructionId)
    {
        return ytConstructionContractMapper.selectYtConstructionContractById(constructionId);
    }

    @Override
    public List<YtCustomerInvoice> selectYtCustomerMsgById(Long customerId) {
        return ytConstructionContractMapper.selectYtCustomerMsgById(customerId);
    }

    /**
     * 查询施工合同列表
     * 
     * @param ytConstructionContract 施工合同
     * @return 施工合同
     */
    @Override
    public List<YtConstructionContract> selectYtConstructionContractList(YtConstructionContract ytConstructionContract)
    {
        return ytConstructionContractMapper.selectYtConstructionContractList(ytConstructionContract);
    }

    /**
     * 新增施工合同
     * 
     * @param ytConstructionContract 施工合同
     * @return 结果
     */
    @Override
    public int insertYtConstructionContract(YtConstructionContract ytConstructionContract)
    {
        return ytConstructionContractMapper.insertYtConstructionContract(ytConstructionContract);
    }

    /**
     * 修改施工合同
     * 
     * @param ytConstructionContract 施工合同
     * @return 结果
     */
    @Override
    public int updateYtConstructionContract(YtConstructionContract ytConstructionContract)
    {
        return ytConstructionContractMapper.updateYtConstructionContract(ytConstructionContract);
    }

    /**
     * 删除施工合同对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteYtConstructionContractByIds(String ids)
    {
        return ytConstructionContractMapper.deleteYtConstructionContractByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除施工合同信息
     * 
     * @param constructionId 施工合同ID
     * @return 结果
     */
    @Override
    public int deleteYtConstructionContractById(Long constructionId)
    {
        return ytConstructionContractMapper.deleteYtConstructionContractById(constructionId);
    }
}
